package com.huarui.part.dao;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.IBaseDao;
import com.huarui.part.model.Part;
import com.huarui.partner.model.Partner;

public interface IPartDao extends IBaseDao {

	public List<Part> getPartListModel();

	public String getPartNameByCode(String code);

	@SuppressWarnings("unchecked")
	public List<Part> getPartListByConditions(Map map);

	@SuppressWarnings("unchecked")
	public Part getPartByConditions(Map map);

	@SuppressWarnings("unchecked")
	public Map getPartByConditionsJson(Map map);

	@SuppressWarnings("unchecked")
	public List<Part> getAllParts(Map map);

	@SuppressWarnings("unchecked")
	public List<Part> getAllComboxPart(Map map);

	public void batchInsert(List<Part> list);

	@SuppressWarnings("unchecked")
	public int getPartListCountByConditions(Map map);
	/**
	 * 根据编码和来源,公司id查询唯一Part 
	 * @param code 
	 * @param source
	 * @param companyId
	 * @return
	 */
	public Part getPartByCodeAndSource(String code,int source,Integer companyId);
	
	@SuppressWarnings("unchecked")
	public Integer getcountByCondition(Map map);

	@SuppressWarnings("unchecked")
	public List<Map> getPartsForMapByConditions(Map map);
    /**
     * 模糊查询零件code
     * @param map
     * @return
     */
	@SuppressWarnings("unchecked")
	public List<Map> getPartCodeListByConditions(Map<String, Object> map);

	public Integer getPartCodeCountByConditions(Map<String, Object> map);

	public Partner getPartnerByIdent(Map map);
	
	public Partner getPartnerByTaxCode(String taxCode);
	/**
	 * 精确查询 如果有多条记录,返回第一条
	 * @param code
	 * @return
	 */
	public Part getPartByCode(String code);

}
